/* global BufferEncoding */
import { Readable } from 'stream';

export type ObjectItem = {
  name: string;
  lastModified: string;
  value: string;
}

export interface ObjectStorage {
  putObject(bucket: string, objectName: string, content: string | Buffer): Promise<any>;
  fPutObject(bucket: string, objectName: string, filePath: string): Promise<any>;
  getObject(bucket: string, objectName: string): Promise<Readable>;
  getString(bucket: string, objectName: string, encoding: BufferEncoding): Promise<string>;
  fGetObject(bucket: string, objectName: string, filePath: string): Promise<any>;
  removeObject(bucket: string, objectName: string): Promise<any>;
  listObjects(bucket: string, objectName: string): Promise<ObjectItem[]>;
  signatureUrl(bucket: string, objectName): Promise<any>;
  fPutObjectWithProgress(bucket: string, objectName: string, filePath: string, progressCallback?: (percentage: number) => void): Promise<any>;
  // copyDir(bucket: string, objectName: string, objectNamePrefix: string): Promise<void>
}